import { Controller, Get } from '@nestjs/common';

import { RsaService } from '@app/rsa';
import { PublicRoute } from './jwt.guard';

// 当前整个路由的接口都是不需要 token 的
@PublicRoute()
@Controller('auth')
export class AuthController {
  constructor(private readonly rsaService: RsaService) {}
  // 获取公钥
  @Get('/get-key')
  getPublicKey() {
    const publicKey = this.rsaService.getPublicKey();
    return publicKey;
  }
}
